<template>
	<div class="page">
		<p class="title">基本用法-alert</p>
		<p>
			<gr-button block @click="open1">alert</gr-button>
		</p>
		
		<p class="title">基本用法-confirm</p>
		<p>
			<gr-button block @click="open2">confirm</gr-button>
		</p>
		
		<p class="title">插入html内容</p>
		<p>
			<gr-button block @click="open3">alert</gr-button>
		</p>
		
		<p class="title">动态组件传参</p>
		<p>
			<gr-button block @click="open4">alert</gr-button>
		</p>
	</div>
</template>

<script>
	export default {
		data() {
			return {
				
			}
		},
		mounted() {
			
		},
		methods: {
			open1() {
				this.$dialog.alert({
					title: '这是标题',
					message: '这是内容内容内容内容内容内容',
					confirmButtonText: '好的呢'
				});
			},
			open2() {
				this.$dialog.confirm({
					title: '这是标题',
					message: '这是确认确认确认确认内容内容内容内容内容内容',
					confirmButtonText: '就这样'
				});
			},
			open3() {
				this.$dialog.alert({
					message: `
						<p style="color: #f40"> <b> 自定义html内容 </b> </p>`
				});
			},
			open4() {
				this.$dialog.alert({
					message: `
						<p style="color: #f40"> <b> 自定义html内容 </b> </p>
						<p> <gr-button :flat="flat" color="primary">按钮</gr-button> </p>`,
					dynamicProps: {
						flat: true
					}	
				});
			}
		}
	}
</script>

<style lang="scss">
	.page {
		padding: 0 10px;
	}
</style>
